#!/bin/bash
#author: xlp 
#date:   20151205

if [ $# -ne 1 ]
then
	echo "pleae enter into the  /home/w60ccd/workspace/result/20151205 "
	echo "xplotlc.sh lcdata [like M151205_C00188_miniOT.lc ]"
fi


lcdata=$1 
output=`echo $lcdata | sed 's/\lc/png/g'`
prefix=`echo $lcdata | sed 's/\lc//g'`
firstobs=`cat $lcdata | awk '{print($2)}'`

gnuplot << EOF
set term png
set output "$output"
set xlabel "Time since $firstobs"
set ylabel "R mag" offset "2"
set grid
set title "$prefix"
set yrange[] reverse
plot '$lcdata' u 1:8:9 w yerror  t 'w60cm'
quit
EOF
